/*
 * 
 * Copyright (C) 2010 Wilfried Elmenreich, Anita Sobe 
 * This file is part of VideoNetwork.
 * 
 * VideoNetwork is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. 
 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 
 * You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>. 
 */
package proxy;

public class HormoneControls {

	/**
	 * Phermone controls: amount of pheromone that is displaced at first request
	 */
	private double hAmount1;
	/**
	 * Amount of pheremone that is displaced each second until unit is there.
	 * The value is multiplied by simStep when used.
	 */
	private double hAmount2;
	/**
	 * Amount of pheromone that diffuses each second to neighbors, the value is
	 * multiplied by simStep when used Thus, this value can also exceed 1 as
	 * long as diffusionAmount * simStep is below 1
	 */
	private double diffusionAmount;
	
	
	private double toGeneral;
	/**
	 * pheromone below that level is considered insignificant
	 */
	private double minHormone;
	/**
	 * amount of pheromone that evaporates each second, the value is multiplied
	 * by simStep when used
	 */
	private double evaporationRate;
	/**
	 * Threshold difference for migrating a unit.
	 */
	private double migrationThreshold;
	/**
	 * Duration after an unused unit is deleted
	 */
	private double cleanUpTriggerTime;
	/**
	 * If a link is occupied at least for this long, it is considered busy
	 */
	private double busyLinkThreshold;

	public HormoneControls() {
		setDefaultParameters();
	}

	public HormoneControls(Double[] ctrls) {
		this.hAmount1 = 1.0; // zusammenziehen
		this.hAmount2 = 1.0; // gleicher wert
		this.diffusionAmount = ctrls[0];
		this.evaporationRate = ctrls[1];
		this.migrationThreshold = 0.0;
		this.minHormone = 0.0;
		this.cleanUpTriggerTime = 0.0; //?
		this.busyLinkThreshold = ctrls[2]; //?
//		this.toGeneral = ctrls[6];

	}

	private void setDefaultParameters() {
		this.hAmount1 = 0.4;
		this.setHAmount2(this.hAmount1);
		this.diffusionAmount = 0.26;
		this.evaporationRate = 0.08;
		this.minHormone = 0.0;
		this.migrationThreshold = 0.00;
		this.cleanUpTriggerTime = 0.04;
		this.busyLinkThreshold = 0.17;
		this.toGeneral = 0.0;

	}

	public double getHAmount1() {
		return hAmount1;
	}

	public void setHAmount1(double hAmount1) {
		this.hAmount1 = hAmount1;
	}



	public double getDiffusionAmount() {
		return diffusionAmount;
	}

	public void setDiffusionAmount(double diffusionAmount) {
		this.diffusionAmount = diffusionAmount;
	}

	public double getMinHormone() {
		return minHormone;
	}

	public void setMinHormone(double minHormone) {
		this.minHormone = minHormone;
	}

	public double getEvaporationRate() {
		return evaporationRate;
	}

	public void setEvaporationRate(double evaporationRate) {
		this.evaporationRate = evaporationRate;
	}

	public double getMigrationThreshold() {
		return migrationThreshold;
	}

	public void setMigrationThreshold(double migrationThreshold) {
		this.migrationThreshold = migrationThreshold;
	}

	public double getCleanUpTriggerTime() {
		return cleanUpTriggerTime;
	}

	public void setCleanUpTriggerTime(double cleanUpTriggerTime) {
		this.cleanUpTriggerTime = cleanUpTriggerTime;
	}

	public double getBusyLinkThreshold() {
		return busyLinkThreshold;
	}

	public void setBusyLinkThreshold(double busyLinkThreshold) {
		this.busyLinkThreshold = busyLinkThreshold;
	}

	public void setPercentToGeneral(double percentToGeneral) {
		this.toGeneral = percentToGeneral;
	}

	public double getPercentToGeneral() {
		return toGeneral;
	}

	public double getHAmount2() {
		return hAmount2;
	}

	public void setHAmount2(double hAmount2) {
		this.hAmount2 = hAmount2;
	}

}
